// ignore_for_file: unused_element

import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';

class MyPermissionHandler {
  // ignore: slash_for_doc_comments
  /**
 *  检测存储权限
 * */
  static Future<bool> checkCalender() async {
    if (GetPlatform.isAndroid) {
      final status = await Permission.calendar.status;
      if (status != PermissionStatus.granted) {
        final result = await Permission.calendar.request();
        if (result == PermissionStatus.granted) {
          return true;
        } else {
          return false;
        }
      } else {
        return true;
      }
    }
    return false;
  }
}
